<?php
/**
 * Author:   tangxiaowen
 * Email:    846506584@qq.com
 * Date:     2019/5/23 0023
 * Describe: 订单验证类.
 */

namespace app\common\validate;

use think\Validate;

class Order extends Validate
{
    protected $rule = [
        'loan_amount' => 'require',
        'loan_term' => 'require',
        'term_type' => 'require',
        'order_sn' => 'require',
        'orderId' => 'require',
        'isLoanAgree' => 'require',
        'repay_type' => 'require',
    ];

    protected $message = [
        'loan_amount' => ['require' => '审批金额 单位（分）不能为空'],
        'loan_term' => ['require' => '审批期限不能为空'],
        'term_type' => ['require' => '请传入 1:按天; 2：按月; 3：按年'],
        'order_sn' => ['require' => '订单编号不能为空'],
        'orderId' => ['require' => '系统异常，请联系管理'],
        'isLoanAgree' => ['require' => '系统异常，请联系管理'],
        'repay_type' => ['require' => '请填写分期业务参数'],
    ];

    protected $scene = [
        'loanCalculate' => ['loan_amount', 'loan_term', 'term_type'],
        'getRepayplan' => ['order_sn'],
        'getOrderStatus' => ['order_sn'],
        'getContracts' => ['order_sn'],
        'waitingConfirm' => ['orderId', 'isLoanAgree'],
        'applyRepay' => ['order_sn', 'repay_type'],
    ];
}
